#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
int main()
{
	float faHeight, moHeight, adultHeight;
	char childsex, sports, diet;
	printf("Hello,my master,this is the programming of persuiting your children'height and please finish the following questions!\n");
	printf("Please input faHeight & moHeight:");
	scanf("%f %f", &faHeight, &moHeight);
	printf("Please input your childsex(boy is M,girl is F):");
	getchar();
	scanf("%c", &childsex);
	printf("Dose your children like sports?(Y is yes,N is no):");
	getchar();
	scanf("%c", &sports);
	printf("Dose your children have good diet?(Y is yes,N is no):");
	getchar();
	scanf("%c", &diet);
	if (childsex == 'M') {
		if (sports == 'Y' && diet == 'Y') {
			adultHeight = ((faHeight + moHeight) * 0.54)*(1 + 0.035);
		}
		else if (sports == 'Y' && diet == 'N') {
			adultHeight = ((faHeight + moHeight) * 0.54)*(1 + 0.02);
		}
		else if (sports == 'N' && diet == 'Y') {
			adultHeight = ((faHeight + moHeight) * 0.54)*(1 + 0.015);
		}
		else if (sports == 'N' && diet == 'N') {
			adultHeight = (faHeight + moHeight) * 0.54;
		}
		printf("The pursuiting of your children height is:%fcm", adultHeight);
	}
	else if (childsex == 'F') {
		if (sports == 'Y' && diet == 'Y') {
			adultHeight =((faHeight * 0.923 + moHeight) / 2)*(1+ 0.035);
		}
		else if (sports == 'Y' && diet == 'N') {
			adultHeight = ((faHeight * 0.923 + moHeight) / 2)*(1+ 0.02);
		}
  else if (sports == 'N' && diet == 'Y') {
			adultHeight = ((faHeight * 0.923 + moHeight) / 2)*(1 + 0.015);
		}
		else if (sports == 'N' && diet == 'N') {
			adultHeight = (faHeight * 0.923 + moHeight) / 2;
		}
		printf("The pursuiting of your children height is:%.2fcm", adultHeight);
	}

	return 0;




}